Version

AddChart(ChartType,Rectangle,Action<WorksheetChart>) Method

Adds a chart to the collection with the specified bounds.
Syntax
'Declaration
 
Public Overloads Function AddChart( _
   ByVal chartType As ChartType, _
   ByVal boundsInTwips As System.Drawing.Rectangle, _
   Optional ByVal chartInitializer As System.Action(Of WorksheetChart) _
) As WorksheetChart
public WorksheetChart AddChart( 
   ChartType chartType,
   System.Drawing.Rectangle boundsInTwips,
   System.Action<WorksheetChart> chartInitializer
)

Parameters

chartType
The type of chart to add to the collection.
boundsInTwips
The bounds of the shape on the worksheet in twips (1/20th of a point).
chartInitializer
An optional callback for initializing the chart before it is added to the collection.

Return Value

A WorksheetChart-instance.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionif worksheet is null.
System.ComponentModel.InvalidEnumArgumentExceptionchartType is not defined in the Infragistics.Documents.Excel.Charts.ChartType enumeration.
System.InvalidOperationExceptionif a chart is being added to the Shapes collection of another Chart is null.
System.InvalidOperationExceptionif a Workbook.CurrentFormat doesn't support Chart mofications, e.g. 'Excel97To2003' or 'Excel97To2003Template'.
Requirements

Target Platforms: Windows 8.1, Windows 8.1, Windows 8, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

View on GitHub